home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Sample Code / MenuScripter / MenuScripter- Read Me next >
Encoding:
Text File  |  1994-02-25  |  2.9 KB  |  39 lines  |  [TEXT/ttxt]

  1. MenuScripter - Read Me
  2. ----------------------
  3.  
  4. MenuScripter is a derivation of 7Edit, a factored text editing sample code application. It has been designed to show how to use the features of the OSA from within your application. As the name implies, many of the menu commands are implemented using scripts instead of hard coding. In many cases the hard coding will also be found within SVAppleEvents.c, but it does not get called if a script to do the same is found.
  5.  
  6. Later these hard coded commands may go, but for now they provide a contrast between the two methods of implementation.
  7.  
  8. To use MenuScripter you must the AppleScript system extension installed. 
  9. Scripts are stored in two representations : 
  10. 'Scpt' - a compiled script extracted from the AppleScript component with OSAStore and saved as a resource.
  11.  
  12. 'SCPT' - a raw textual script.
  13.  
  14. Menu scripts are stored as resources with ID equal to theMenuID*32 + the item number within the menu. A script works for the whole menu if it has a resource id of 32*theMenuID.
  15.  
  16. MenuScripter does not only allow the use a scripts to drive menus, it also allows them to be edited. To edit the script for a menu simply hold control and option down as you select a menu item, and you will be presented with a dialog allowing editing of the script.
  17.  
  18. Scripts are built in for the following menu items, all of which can be edited. It will be a simple matter for you to add an 'SCPT' resource to the MenuScripter.r file to add scripts for other menu items. The items with scripts attached are:
  19.  
  20. File Menu: New, Close, Print & Quit
  21. Edit Menu: Cut, Copy, Paste, Clear, Select All, Create Publisher…, Show Borders
  22. Font Menu: Each item has the appropriate script attached to it
  23. Style Menu: Each item has a script attached.
  24.  
  25. MenuScripter 3.0d6 includes a few bug fixes from 3.0d5 which was included in the AppleScript Beta CD. In particular, the Font, Size and Style menus now function correctly. 
  26.  
  27. Please note that there are some problems with recording in this version and you may need to edit some scripts to play them back. Keep an eye on the AppleScript Talk board on AppleLink for the latest updates.
  28.  
  29. Enjoy,
  30.  
  31. Regards,
  32.  
  33. Jon Lansdell
  34.  
  35. ----------------------------------------------------------------------------
  36.  
  37. Please note that this sample code was originally written while SRL Data provided support to UK Developers, under contract from Apple UK, via UK.DTS. Due to the reorganisation of European Developer Services from January 1st 1993 we are no longer performing the UK DTS function, but since lots of developers found the 7Edit and MenuScripter code (included on the AppleScript Beta CD) useful we have decided to keep the samples up to date and available to all developers. Link bugs, comments and suggestions to SRL Data at AppleLink: UK0001. 
  38.  
  39. However, we will not answer any technical questions on these samples- registered Apple Partners should direct their questions to DEVSUPPORT.